<?php
/**
  * Mar 11, 2008
  *
  * Coded by: Ropu
  *
  */


class Hi5Test extends Hi5 {
  
  public function __construct() {
//    parent::__construct(null, null, null);
  }

  public function auth($hi5AuthToken=null, $msg='ACK') {
    try {
      return Http::get("http://api.hi5.com/" . $this->type . "/test/auth", 
//	    return Http::get("http://localhost:8888/test/post.php", 
                        array("Hi5AuthToken" => $hi5AuthToken, 
	                            "message" => $msg)
	                      ); 
	  } catch (HttpException $e) {
      switch($e->getCode()) {
        case '403':
          throw new PermissionDeniedException($e->getMessage(), '403');
          break;
        default:
          throw new Exception($e->getMessage(), $e->getCode());
          break;
      }
    }
  }
    
  public function testEcho($msg='ACK') {
    "	http://api.hi5.com/rest/test/echo" . $msg;
    
  }

  public function exception($exception='PermissionDeniedException') {
    
    "http://api.hi5.com/rest/test/exception/" . $exception;
  }
}